home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998…tember: Reference Library / Dev.CD Sep 98 RL1.toast / Technical Documentation / develop / develop Issue 24 / develop Issue 24 code / Scriptable Database 1.0a15.sea / Scriptable Database 1.0a15 / Scripting / ScriptErrors.cp / ScriptErrors.cp
Encoding:
Text File  |  1996-02-20  |  1016 b   |  39 lines  |  [TEXT/CWIE]

  1.  
  2. #include "ScriptErrors.h"
  3. #include "MoreAEM.h"
  4.  
  5. //
  6. // For kOSAErrorOffendingObject and nothing else
  7. //
  8. #include "OSA.h"
  9.  
  10. //----------------------------------------------------------------------------------------
  11. // ProcessError
  12. //----------------------------------------------------------------------------------------
  13. void ProcessError(OSErr err, TDescriptor& offendingObject, TAEvent& reply)
  14.     {
  15.     if((reply.IsNullDescriptor() == false) && (err != noErr))
  16.         {
  17.         //
  18.         // Put the error number into the reply
  19.         //
  20.         reply.PutSInt32Parameter(keyErrorNumber, err);
  21.         
  22.         //
  23.         // At this point the application should look up an appropriate
  24.         // error string, if it can generate one, and place it into
  25.         // the parameter keyErrorString.
  26.         //
  27.         
  28.         //
  29.         // Put a reference to the offending object into the
  30.         // reply as well (if one is available)
  31.         //
  32.         if(offendingObject.IsNullDescriptor() == false)
  33.             {
  34.             reply.PutDescriptorParameter(kOSAErrorOffendingObject, offendingObject);
  35.             offendingObject.Dispose();
  36.             }
  37.         }
  38.     }
  39.